package com.lei.applt;

import java.awt.Graphics;
import java.awt.Image;

import javax.swing.JPanel;

public class SysBackgroundImage extends JPanel {

	private static final long serialVersionUID = 1L;
	private   int width;
	private  int height;
	private  Image img;
	
	public SysBackgroundImage(Image img,int width,int height){
		this.img = img;
		this.width=width;this.height=height;
		repaint();
	}
	
	public SysBackgroundImage(Image img){
		this.img = img;
		repaint();
	}
	
	@Override
	protected void paintComponent(Graphics g) {
		super.paintComponent(g);
		g.drawImage(img, 0, 0, width, height, this);
	}
}
